In an electronic device, a memory device can be used to store data and machine-readable instructions. A memory device can include a dynamic random access memory (DRAM) device, a flash memory device, or another type of memory device. To protect data stored in the memory device, error detection and correction can be performed. Error detection and correction can be based on error correction codes that are stored in conjunction with data in the memory device.